<template>
  <div class="commonModal" v-show="show==true">
    <div class="bg-layer"></div>
    <div class="common-content">
      <div class="modal-box">
        <div class="message">{{message}}</div>
        <button type="button" @click="jumpTo()">{{btnText}}</button>
      </div>
    </div>
  </div>
</template>

<script type="text/ecmascript-6">
export default {
  props: {
    btnText: {
      type: String
    }
  },
  data() {
    return {
      show: false,
      message: ""
    };
  },
  methods: {
    jumpTo() {
      this.$emit("go");
    }
  }
};
</script>

<style lang="less">
@r: 1rem/75;
.commonModal {
  .common-content {
    position: fixed;
    top: 50%;
    left: 50%;
    -webkit-transform: translate3d(-50%, -50%, 0);
    transform: translate3d(-50%, -50%, 0);
    background-color: #fff;
    width: 85%;
    border-radius: 6px;
    -webkit-user-select: none;
    overflow: hidden;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    z-index: 3000;
    animation: zoomIn 0.3s linear;

    .modal-box {
      width: 100%;
      height: 100%;
      position: relative;
      padding-bottom: 40 * @r;

      .message {
        padding: 48 * @r 30 * @r;
        font-size: 34 * @r;
        color: #333;
        text-align: center;
      }

      button {
        width: 85%;
        height: 100 * @r;
        display: block;
        background: #e33f3f;
        border-radius: 4px;
        border: none;
        font-size: 32 * @r;
        color: #fff;
        margin: 0 auto;
      }
    }
  }
}
</style>
